<template>
  <el-dialog title="标记内容" class="tl-dialog" width="40%" :visible.sync="visible" :with-header="false" :modal-append-to-body="true" :append-to-body="true" :destroy-on-close="true" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" label-width="100px" style="height: 12vh" :disabled="disableEditSubmit">
      <el-row>
        <el-col :span="24">
          <el-form-item label="标记内容" prop="operateresult" :rules="rules.validateRequire">
            <el-input v-model="model.operateresult" type="textarea" maxlength="1000" show-word-limit :autosize="{ minRows: 4, maxRows: 6 }"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="分享人员" prop="username">
            <tlRefList ref="sharePeople" v-model="model.operatedescription" :initDisplayData.sync="model.dispoperatedescription" dataType="code" :singleSelect="false" :queryDataUrl="queryDataUrl"></tlRefList>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button v-if="!disableEditSubmit" type="primary" @click="doSubmitEdit" :loading="saveLoading">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
import tlRefList from '@tapui/components/Tap/Ref/RefList'
import { Mpm_Sign_All_People, Mpm_Sign_All_DispPeople } from '@/const/const'
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { tlRefList },
  data() {
    return {
      url: {
        load: '/mpm/project/loadSign',
        add: '/mpm/project/insertSign',
        edit: '/mpm/project/updateSign'
      },
      sourceid: 0,
      sourcetype: '',
      queryDataUrl: '/mpm/project/querySignPeople'
    }
  },
  props: {
    code: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: ''
    }
  },
  methods: {
    /** 组件创建 */
    assignDefaultValue() {
      if (this.isAdd) {
        this.$set(this.model, 'orgcode', this.org.code)
        this.$set(this.model, 'deptcode', this.dept.code)
        this.$set(this.model, 'usercode', this.user.code)
        this.$set(this.model, 'username', this.user.name)
        this.$set(this.model, 'sourceid', this.sourceid)
        this.$set(this.model, 'sourcetype', this.sourcetype)
        this.$set(this.model, 'operatedate', new Date())
        this.$set(this.model, 'operatetype', 'sign')
        this.$set(this.model, 'operatedescription', this.code)
        this.$set(this.model, 'dispoperatedescription', this.name)
      }
    }
  }
}
</script>
